* Multiproduct Firms, Horizontal Mergers, and International Trade
* Jackie M.L. Chan, Michael Irlacher, and Michael Koch

* This do file calculates summary statistics for Appendix Table A.8.

* Domestic market
use "D:\Data\Workdata\703989\FJSJ3989\CIK\replication_restat\data\regression_data_domestic.dta", clear

areg theil_fy p1 p2 p3 p4 test m1 m2 m3 m4 D_AA_1-D_AA_22 if minemployee_cvrnr>=10, absorb(cvrnrA) cluster(ind)
gen sample1 = e(sample)

areg lnnprodAT_nodup p1 p2 p3 p4 test m1 m2 m3 m4 D_AA_1-D_AA_22 if minemployee_cvrnr>=10 & ((acquirer==1 & ((nprodT>0 & d_yr<=0) | d_yr>0)) | acquirer==0), absorb(cvrnrA) cluster(ind)
gen sample2 = e(sample)

log using "D:\Data\Workdata\703989\FJSJ3989\CIK\replication_restat\output\table_A8.log", replace
sum lnnprod lnvrdA theil_fy lnrev_max lnrev_med lnrev_min if sample1==1
sum lnnprodAT_nodup if sample2==1
log off

**********************************************
* Export market
use "D:\Data\Workdata\703989\FJSJ3989\CIK\replication_restat\data\regression_data_export.dta", clear

areg lnnmark p1 p2 p3 p4 test m1 m2 m3 m4 D_AA_1-D_AA_25 if minemployee_cvrnr>=5 & _mergedist==3, absorb(cvrnrA) cluster(ind)
gen sample1 = e(sample)

areg lnnprodpermark p4 p3 p2 p1 test m1 m2 m3 m4 D_AA_1-D_AA_25 if minemployee_cvrnr>=5 & ((acquirer==1 & max_merge==3) | acquirer==0) & _mergedist==3, absorb(cvrnrA) cluster(ind)
gen sample2 = e(sample)

log on
sum lnnmark lnnprod lnnprodmark p90_ldistw p90_lr_ltradingimportdocs p90_lr_ltradingimporttime p90_lr_ltradingimportcost_def if sample1==1
sum lnnprodpermark if sample2==1
log close
